﻿@page
@{ Layout = "_Layout"; }
@section Styles{
  <style>
    .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
      margin-bottom: 0;
    }
  </style>
}

<div style="height: 10px"></div>
<el-form v-on:submit.native.prevent ref="form" :model="form" :inline="true" size="small" :rules="{
  path: [
    { required: true, message: '请输入文件路径', trigger: 'blur' }
  ]
}">
  <el-form-item label="文件路径" prop="path">
    <el-input v-model="form.path" style="width: 450px;" placeholder="请输入文件路径">
      <template slot="prepend">{{getFileTypeDir()}}</template>
      <template slot="append">.{{fileType}}</template>
    </el-input>
    <div class="tips">路径以/分隔，请勿包含文件后缀</div>
  </el-form-item>
</el-form>

<el-row>
  <el-col :span="24">
    <el-button type="text" icon="el-icon-brush" v-on:click="btnFormatClick">格式化代码</el-button>
  </el-col>
</el-row>

<div id="content" style="width:99%; height: 450px; border: 1px solid #d7dae2;"></div>

<div style="margin-top: 15px; text-align: center">
  <el-button type="primary" size="small" v-on:click="btnSubmitClick(false)">保 存</el-button>
  <el-button type="success" size="small" v-on:click="btnSubmitClick(true)">保存并关闭</el-button>
  <el-button type="info" size="small" v-on:click="btnCloseClick">关 闭</el-button>
</div>

@section Scripts{
<script src="/sitefiles/assets/lib/monaco-editor/min/vs/loader.js"></script>
<script src="/sitefiles/assets/js/admin/cms/templatesAssetsEditor.js" type="text/javascript"></script>
}
